// 公共API
const install = (Vue, vm) => {
  //获取公告
  let getNoticeList = (pageNo, pageSize, data) =>
    vm.$zx.post(`/api/myInfo/listStationMessage/${pageNo}/${pageSize}`, data);
  let getBankList = (pageNo, pageSize, data) =>
    vm.$zx.post(`/api/common/listBank/${pageNo}/${pageSize}`, data);
  // 分页查询支行
  // let getBankList = (pageNo, pageSize) => vm.$zx.post(`/branch/list/${pageNo}/${pageSize}`);
  let getBankBranchList = (pageNo, pageSize, data) =>
    vm.$zx.post(`/api/common/listBranch/${pageNo}/${pageSize}`, data);
  let listProvinceCityArea = () =>
    vm.$zx.get(`/api/common/listProvinceCityArea`);
  let uploadImage = (data) => vm.$zx.get(`/aliyun/uploadImage`, data);
  let getOCRRead = (data) => vm.$zx.post(`/common/ocr`, data);
  let readAllStationMessage = (data) =>
    vm.$zx.get(`/api/myInfo/readAllStationMessage`, data);
  // 查询代理商没有的成本配置
  let getQueryAgentNotHasCostConfig = (agentNo) =>
    vm.$zx.get(`/api/agent/queryAgentNotHasCostConfig/${agentNo}`);
  // 查询代理商已有的成本配置
  let getQueryAgentHasCostConfig = (agentNo) =>
    vm.$zx.get(`/api/agent/queryAgentHasCostConfig/${agentNo}`);
  // 修改代理成本-新增业务列表
  let editUpdateAgentCost = (agentNo, data) =>
    vm.$zx.post(`/api/agent/updateAgentCost/${agentNo}`, data);
  // 查询代理商已有的活动配置
  let getQueryAgentHasActivityConfig = (agentNo) =>
    vm.$zx.get(`/api/agent/queryAgentHasActivityConfig/${agentNo}`);
  // 查询代理商没有的活动配置
  let getQueryAgentNotHasActivityConfig = (agentNo) =>
    vm.$zx.get(`/api/agent/queryAgentNotHasActivityConfig/${agentNo}`);
  // 修改代理返现/新增代理返现-新增活动
  let editUpdateAgentCashBack = (agentNo, data) =>
    vm.$zx.post(`/api/agent/updateAgentCashBack/${agentNo}`, data);
  // 操作返现开关
  let editCashbackSwitch = (agentNo, status) =>
    vm.$zx.post(`/api/agent/cashbackSwitch/${agentNo}/${status}`);
  // 操作分润代付开关
  let editProfitSwitch = (agentNo, status) =>
    vm.$zx.post(`/api/agent/profitSwitch/${agentNo}/${status}`);
  // 操作结算分润代付开关
  let editSettleProfitSwitch = (agentNo, status) =>
    vm.$zx.post(`/api/agent/settleProfitSwitch/${agentNo}/${status}`);
  // 根据商户编号查询商户费率信息
  let getQueryMerRateChangeApply = (merchantNo) =>
    vm.$zx.post(`/api/merchantRate/queryMerRateChangeApply/${merchantNo}`);
  // 变更商户费率
  let editUpdateMerPosRate = (merchantNo, data) =>
    vm.$zx.put(`/api/merchantRate/updateMerPosRate/${merchantNo}`, data);
  vm.$zx.common_api = {
    getNoticeList,
    getBankList,
    listProvinceCityArea,
    uploadImage,
    getOCRRead,
    getBankBranchList,
    readAllStationMessage,
    editUpdateAgentCost,
    getQueryAgentHasCostConfig,
    getQueryAgentNotHasCostConfig,
    getQueryAgentHasActivityConfig,
    editUpdateAgentCashBack,
    editCashbackSwitch,
    editProfitSwitch,
    editSettleProfitSwitch,
    getQueryAgentNotHasActivityConfig,
    getQueryMerRateChangeApply,
    editUpdateMerPosRate,
  };
};

export default {
  install,
};
